package com.tl.architecture.base.activity

import androidx.databinding.ViewDataBinding
import androidx.lifecycle.ViewModelProvider
import com.tl.architecture.base.viewmodel.BaseViewModel
import java.lang.reflect.ParameterizedType

abstract class BaseVDBVMActivity<VDB : ViewDataBinding, VM : BaseViewModel> :
    BaseVDBActivity<VDB>() {
    val viewModel:VM by lazy {
        val type =
            (javaClass.genericSuperclass as ParameterizedType).actualTypeArguments[1] as Class<VM>
        ViewModelProvider(this)[type]
    }
}